﻿<%@ Page Language="C#" MasterPageFile="~/Themes/ContentPage.master" %>
<script runat="server">

    public int CategoryId
    {
        get { return SiteContext.Current.CategoryId; }
    }

    private string NodeTitle
    {
        get { return TreeTables.NewsCategories.GetCategoryName(SiteContext.Current.BaseNodeId); }
    }

    private string CurrentCategoryName
    {
        get { return TreeTables.NewsCategories.GetCategoryName(this.CategoryId); }
    }

    private string CurrentCategoryUrl
    {
        get { return SiteUrls.Urls.NewsSearch(SiteContext.Current.BaseNodeId, SiteContext.Current.CategoryId, string.Empty); }
    }

    private NewsInfo nextNews;
    public NewsInfo NextNews
    {
        get
        {
            if (this.nextNews == null)
                this.nextNews = News.GetNextNews(this.CategoryId,SiteContext.Current.Id);

            if (this.nextNews == null)
                this.nextNews = new NewsInfo();
            
            return this.nextNews;
        }
    }

    private NewsInfo prevNews;
    public NewsInfo PrevNews
    {
        get
        {
            if (this.prevNews == null)
                this.prevNews = News.GetPrevNews(this.CategoryId, SiteContext.Current.Id);

            if (this.prevNews == null)
                this.prevNews = new NewsInfo();
            
            return this.prevNews;
        }
    }
    
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="mainContent" runat="Server">
    <lswweb:NewsShow ID="newsShow" SkinFileName="Globals_NewsShow.ascx" IsRenderTag="false" runat="server" />
</asp:Content>
